﻿#include "mygraphicsview.h"

myGraphicsView::myGraphicsView(QWidget *parent) :
    QGraphicsView(parent)
{

}

void myGraphicsView::mouseDoubleClickEvent(QMouseEvent *event)
{

    QPoint point = event->pos();
    QPointF pointf = this->mapToScene(point);
    QGraphicsItem* items = this->scene()->itemAt(pointf,this->transform());
    if(items->data(0).toInt() > 0){
        emit getPix(items->data(0).toInt());
        this->scene()->removeItem(items);
    }
    emit QGraphicsView::mouseDoubleClickEvent(event);
}

void myGraphicsView::mousePressEvent(QMouseEvent *event)
{
    qDebug() <<event->pos();
}
